

import java.awt.GridLayout;
import java.awt.TextField;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JFrame;


@SuppressWarnings("serial")
public class ItemWindow extends JPanel {    
	
	private JButton Login;
	private JButton Register;
	private TextField username;
	private TextField password;
	private JLabel usernamelabel;
	private JLabel passwordlabel;
	private JLabel spacelabel;
	private JLabel spacelabel2;
	
	
	public ItemWindow() 
	{
        super(new GridLayout(4,4)); //4 rows, 4 columns
       
        //labels and textfields
        usernamelabel = new JLabel("Username");
        username = new TextField(30);        
		passwordlabel = new JLabel("Password");
		password = new TextField(30);
		spacelabel = new JLabel("");//empty label		
		spacelabel2 = new JLabel("");
		Login = new JButton("Login");
		Login.setToolTipText("Login");
		Login.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
		Login.setFocusable(false);
		Register = new JButton("Register");
		Register.setToolTipText("New to Sniper? Just Register");
		Register.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
		Register.setFocusable(false);
	
		//add lebels and textfields
		add(usernamelabel); 	
        add(username);        
		add(passwordlabel);			
		add(password);		
		add(spacelabel);
		add(spacelabel2);
		add(Login); 
		add(Register);
    } 

    /**
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the event-dispatching thread.
     */
	
    private static void createAndShowGUI() 
    {
        //Create and set up the window.
        JFrame frame = new JFrame("Log In");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Create and set up the content pane.
        ItemWindow newContentPane = new ItemWindow();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);
        //Display the window.
        frame.pack();
        frame.setVisible(true);
        frame.setResizable(false);
        frame.setLocation(400,350);
    }

    public static void main(String[] args) 
    {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}